import time

from app.modules.apps.container_ad import AdempiereApp

ad = AdempiereApp(app_id='gzidc:erp',
                  app_name='erp',
                  zone_home_path='/usr/local/app/uc.gzidc.area',
                  zone_alias='gzidc',
                  port='1280',
                  nas_app_package_path='/mnt/winitRelease/tms/1.82.0_161122_1849',
                  db_name='ADEMPIERE')

ad.clear_app_log()
ad.stop()
print ad.is_started()

ad.uninstall_app()
ad.install_app()
ad.restart()
time.sleep(3)
print ad.is_started()

# ad.stop()
time.sleep(3)
print ad.is_started()
